-
-
Notifications
You must be signed in to change notification settings - Fork 365
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow apc_modbus
instances to monitor several USB devices on the same system
#2790
Draft
jimklimov
wants to merge
7
commits into
networkupstools:master
Choose a base branch
from
jimklimov:issue-2609
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+50
−3
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…the freed reopen_matcher does not remain in the chain from best_matcher upwards [networkupstools#2609] Signed-off-by: Jim Klimov <[email protected]>
…her and reopen_matcher [networkupstools#2609] Signed-off-by: Jim Klimov <[email protected]>
…from current_matcher->match_function() [networkupstools#2609] Signed-off-by: Jim Klimov <[email protected]>
…etail printout from libusb1.c [networkupstools#2609] Signed-off-by: Jim Klimov <[email protected]>
…ommon return codes from matcher methods, like libusb1.c does [networkupstools#2609] Notably, handle active rejection of a candidate device by the matcher properly - go try the next device! Signed-off-by: Jim Klimov <[email protected]>
…atcher in the list is the old reopen_matcher(), rely on _apc_modbus_create_reopen_matcher() to do the right job [networkupstools#2609] Signed-off-by: Jim Klimov <[email protected]>
Will convert to draft for now, according to reports in #2609 some of these changes may be wrong; at least the driver seems to lock up and time out in initial data collection from an actual UPS. Maybe I've got the "matcher" list manipulation wrong, will need to review again. |
❌ Build nut 2.8.2.2712-master failed (commit 7395a2955b by @jimklimov) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
APC
impacts-release-2.8.2
Issues reported against NUT release 2.8.2 (maybe vanilla or with minor packaging tweaks)
modbus
need testing
Code looks reasonable, but the feature would better be tested against hardware or OSes
USB
USB-duplicate-devices
Track bugs and issues about monitoring several devices that seem identical to NUT or libusb
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As part of discussion at #2609 an issue was identified, where the driver did not ignore devices actively rejected by a matcher (e.g. one with a different serial number string), and so two drivers tried to manage the same device.
This probably does not solve the main problems of that ticket, but at least gets us one problem less...
Another change is about trying to clean out
reopen_matcher
if we need to free it during reconnection. Original code seemed to assume it was the first one in stack, new code tries to walk the list of known matchers and actually check for it before freeing, and drop the linked list entry.This also brings in the familiar NUT printout of USB device details, e.g. (matching the FTDI Serial-USB chip below, for the lack of actual APC UPS here, with an extra char in Serial field):
Similar match for the correct serial (fails later as a not-modbus device, but that is beside the point):
It should also fix the
_apc_modbus_usb_callback: Failed to match!: Success
reports :)